#include <iostream>

using namespace std;

int n;
string str;
int s, z, v;
int maxv = -1;

int main()
{
	cin >> n;
	
	for (int i = 0; i < n; i ++ )
	{
		string a;
		int d, b, c, sum;
		cin >> a >> b >> c >> d;
		sum = b + c + d;
		if (sum > maxv)
		{
			maxv = sum;
			str = a;
			s = b;
			z = c;
			v = d;
		} 
	}
	
	cout << str << ' ' << s << ' ' << z << ' ' << v;
	
	return 0; 
}
